package com.vercon.moensmart.newtork;


import com.vercon.moensmart.mode.request.DeviceCommandRequest;
import com.vercon.moensmart.mode.request.DeviceIdRequest;
import com.vercon.moensmart.mode.request.MoenTekenRequest;
import com.vercon.moensmart.mode.response.AllDevices;
import com.vercon.moensmart.mode.response.BaseResponse;
import com.vercon.moensmart.mode.response.FollowMember;
import com.vercon.moensmart.mode.response.HealthAdvice;
import com.vercon.moensmart.mode.response.HealthMeasure;
import com.vercon.moensmart.mode.response.HomeList;
import com.vercon.moensmart.mode.response.Inspiration;
import com.vercon.moensmart.mode.response.MeasureTrendChart;
import com.vercon.moensmart.mode.response.MoenToken;
import com.vercon.moensmart.mode.response.OneDevice;
import com.vercon.moensmart.mode.response.UserInfo;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface MoenApi {

    @POST("v1/oauth2/token")
    Observable<MoenToken> getMoenToken(@Body MoenTekenRequest body);

    @GET("api/enduser//enduser_info")
    Observable<BaseResponse<UserInfo>> getUserInfo();

    @GET("api/enduser/health_measure")
    Observable<BaseResponse<HealthMeasure>> getHealthMeasure(@Query("year_month") String year_month, @Query("follow_enduser_id")String follow_enduser_id,
                                                             @Query("data_type")String data_type, @Query("page_size")String page_size,
                                                             @Query("next")String next);
    @GET("api/enduser/health_advice")
    Observable<BaseResponse<HealthAdvice>> getHealthAdvice(@Field("follow_enduser_id")String follow_enduser_id);

    @GET("api/enduser/measure_trend_chart")
    Observable<BaseResponse<MeasureTrendChart>> getMeasureTrendChart(@Query("day_week_month_year")String day_week_month_year,@Query("pick_date")String pick_date,
                                                                     @Query("pick_date_range")String pick_date_range,@Query("pick_month")String pick_month,
                                                                     @Query("pick_year")String pick_year,@Query("follow_enduser_id")String follow_enduser_id);

    @GET("api/enduser/follow_member")
    Observable<BaseResponse<FollowMember>> getFollowMember();

    @GET("api/enduser/home")
    Observable<BaseResponse<HomeList>> getHomeList();

    @GET("api/enduser/device/detail")
    Observable<BaseResponse<OneDevice>> getOneDevices(@Field("device_id")String deviceId);

    @GET("api/enduser/devices")
    Observable<BaseResponse<AllDevices>> getAllDevices();

    @GET("api/enduser/inspiration")
    Observable<BaseResponse<Inspiration>> getInterceptor();

    @POST("api/enduser/command")
    Observable<BaseResponse<Object>> sendCommand(@Body DeviceCommandRequest body);

    @POST("api//enduser/thing_shadow")
    Observable<BaseResponse<Object>> getDeviceInfo(@Body DeviceIdRequest body);
}